package com.itheima.mapdemo.hashmapstudent;

import java.util.HashMap;

public class Test {
    public static void main(String[] args) {
        HashMap<Student, String> map = new HashMap<>();
        Student s1 = new Student("张三", 18);
        Student s2 = new Student("张三1", 17);
        Student s3 = new Student("张三2", 19);
        map.put(s1,"江苏");
        map.put(s2,"北京");
        map.put(s3,"深圳");
//foreach循环,使用lumbda表达式
        map.forEach(
                (key,value) -> {
                    System.out.println(key + "----" + value);
                }
        );
        System.out.println("================");

    }
}
